package timbap.visualizer.api.context;

import processing.core.PApplet;
import timbap.visualizer.api.context.messaging.MessagingManager;
import timbap.visualizer.api.context.playlist.PlaylistManager;
import timbap.visualizer.api.context.recorditems.RecordItemManager;
import timbap.visualizer.api.context.textures.TextureCacheManager;

/**
 * The <code>PluginContext</code> interface provides methods for
 * the accessing the relevant application context from every plugin.
 *
 * It contains methods to set and retrieve the processing applet, 
 * the timbap configuration and all relevant manager instances.
 *
 * @author  Andreas Pabst
 * @see     timbap.visualizer.api.plugin.Plugin
 */
public interface PluginContext<T> {

    /**
     * creates a copy of this plugin context and returns it
     * 
     * @return	a copy of this plugin context
     */
    public PluginContext<T> cloneContext();

    /**
     * gets the record item manager
     * 
     * @return	the record item manager
     */
    public RecordItemManager getRecordItemManager();

    /**
     * sets the record item manager
     * 
     * @param pRecordItemManager	the record item manager to set
     */
    public void setRecordItemManager(RecordItemManager pRecordItemManager);

    /**
     * gets the playlist manager
     * 
     * @return	the playlist manager
     */
    public PlaylistManager getPlaylistManager();

    /**
     * sets the playlist manager
     * 
     * @param pPlaylistManager	the playlist manager to set
     */
    public void setPlaylistManager(PlaylistManager pPlaylistManager);

    /**
     * gets the timbap configuration
     * 
     * @return	the timbap configuration
     */
    public Configuration getCfg();

    /**
     * sets the timbap configuration
     * 
     * @param pCfg	the timbap configuration to set
     */
    public void setCfg(Configuration pCfg);

    /**
     * gets the processing applet
     * 
     * @return	the processing applet
     */
    public PApplet getP5Applet();

    /**
     * sets the processing applet
     * 
     * @param pP5Applet	the processing applet to set
     */
    public void setP5Applet(PApplet pP5Applet);

    /**
     * gets the texture cache manager
     * 
     * @return	the texture cache manager
     */
    public TextureCacheManager getTextureCacheManager();

    /**
     * sets the texture cache manager
     * 
     * @param pTextureCacheManager	the texture cache manager to set
     */
    public void setTextureCacheManager(TextureCacheManager pTextureCacheManager);

    /**
     * gets the messaging manager
     * 
     * @return	the messaging manager
     */
    public MessagingManager<T> getMessagingManager();

    /**
     * sets the messaging manager
     * 
     * @param pMessagingManager	the messaging manager to set
     */
    public void setMessagingManager(MessagingManager<T> pMessagingManager);

}
